package com.geyue.core.service.impl;

import com.geyue.common.base.service.impl.BaseServiceImpl;
import com.geyue.core.mapper.LiveMapper;
import com.geyue.core.model.Live;
import com.geyue.core.model.Student;
import com.geyue.core.service.LiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Lyon on 2017/3/27.
 */
@Service
public class LiveServiceImpl extends BaseServiceImpl<Live> implements LiveService {

    @Autowired
    private LiveMapper liveMapper;


    @Override
    public List<Live> queryAll() {

        return liveMapper.queryAll();
    }

    @Override
    public int addTotalById(int id) {

        return liveMapper.addTotalById(id);
    }

    @Override
    public int decreaseTotalById(int liveId) {

        return liveMapper.decreaseTotalById(liveId);
    }

    @Override
    public Live getLive(int id) {

        return liveMapper.getLive(id);
    }

    @Override
    public int getTotal(int id) {

        return liveMapper.getTotal(id);
    }

    @Override
    public List<Student> getStudent(int id,int type) {

        return liveMapper.getStudent(id,type);
    }

    @Override
    public List<Live> getTopList() {
        return liveMapper.getTopList();
    }

    public List<Live> searchLive(String keyword) {

        return liveMapper.searchLive(keyword);
    }

}
